#ifndef HCVIEW_H
#define HCVIEW_H

#include <QWidget>
#include "hcviewdata.h"
#include "hcstyle.h"
#include "hcsection.h"
#include "hcundo.h"
#include "hcscrollbar.h"
#include "hcrichscrollbar.h"
#include "hccommon.h"
#include "hcsectiondata.h"

class HCAnnotatePre
{

};

class HCView : public QWidget
{
    Q_OBJECT
public:
    explicit HCView(QWidget *parent = nullptr);

protected:
    void paintEvent(QPaintEvent *event);

private:
    QString FFileName;
    QString FPageNoFormat;
    HCStyle FStyle;
    QList<HCSection> FSections;
    HCUndoList FUndoList;
    HCScrollBar FHScrollBar;
    HCRichScrollBar FVScrollBar;
    QPixmap FDataBmp;
    int FActiveSectionIndex, FViewWidth, FViewHeight, FDisplayFirstSection, FDisplayLastSection;
    uint FUpdateCount;
    Byte FPagePadding;
    Single FZoom;
    bool FAutoZoom;
    bool FIsChanged;
    HCAnnotatePre FAnnotatePre;
    HCViewModel FViewModel;  // 界面显示模式：页面、Web
    HCCaret FCaret;
    QEvent *FOnCaretChange, *FOnVerScroll, *FOnHorScroll, *FOnSectionCreateItem, *FOnSectionReadOnlySwitch,
        *FOnSectionCurParaNoChange, *FOnSectionActivePageChange;

    StyleItemEvent *FOnSectionCreateStyleItem;
    FloatStyleItemEvent *FOnSectionCreateFloatStyleItem;
//    OnCanEditEventHandler *FOnSectionCanEdit;
//    TextEventHandler *FOnSectionInsertTextBefor;
//    SectionDataItemEventHandler *FOnSectionInsertItem, *FOnSectionRemoveItem;
//    SectionDataItemNoFunEvent *FOnSectionSaveItem;
//    SectionDataActionEventHandler *FOnSectionAcceptAction;
//    SectionDrawItemPaintEventHandler *FOnSectionDrawItemPaintAfter, *FOnSectionDrawItemPaintBefor;

//    SectionPaintEventHandler *FOnSectionPaintHeader, *FOnSectionPaintFooter, *FOnSectionPaintPage,
//        *FOnSectionPaintPaperBefor, *FOnSectionPaintPaperAfter;
//    PaintEventHandler FOnPaintViewBefor, FOnPaintViewAfter;

    QEvent *FOnChange, *FOnChangedSwitch, *FOnZoomChanged, *FOnViewResize;

signals:

};

#endif // HCVIEW_H
